<?php
/**
 * Created by PhpStorm.
 * User: mj
 * Date: 17-7-4
 * Time: 下午12:00
 */

namespace Mjrnamei\SwooleHttp\Console;


class Output implements OutputInterface
{
    const LINE = '======================' . PHP_EOL;

    public function vardump($object ,...$args)
    {
        $output = self::LINE;
        if(is_array($object) || is_object($object)){
            ob_start();
            var_dump($object);
            $output .= ob_get_flush();
            ob_clean();
            return $this->render($output . PHP_EOL .  self::LINE);
        }
    }

    public function render($string)
    {
        echo $string ;
    }

    public function renderTab($length)
    {
        return str_repeat(" " ,$length);
    }

}
